﻿using AdminStystem.Domain;
using AdminSytem.Application;
using AdminSytem.Application.Dto;
using AdminSytem.Application.Processingrs;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AdminSytem.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessingrController : ControllerBase
    {
        public readonly IProcessingrServices processingrServices;

        public ProcessingrController(IProcessingrServices processingrServices)
        {
            this.processingrServices = processingrServices;
        }
        [HttpPost]
        public async Task<ResultDto<int>> AddProcessingr(ProcessingrDto dto)
        {
            return await processingrServices.AddProcessingr(dto);
        }
        [HttpGet]
        public async Task<ResultDto<Processingr>> GetProcessingr(int id)
        {
            return await processingrServices.GetProcessingr(id);
        }
        [HttpPost]
        public async Task<ResultDto<int>> AddPEnterprise(PEnterpriseDto dto)
        {
            return await processingrServices.AddPEnterprise(dto);
        }
        [HttpGet]
        public async Task<ResultDto<PEnterprise>> GetPEnterprise(int id)
        {
            return  await processingrServices.GetPEnterprise(id);
        }
        [HttpPost]
       public async Task<ResultDto<int>> AddrawMaterial(RawMaterialDto dto)
        {
            return await processingrServices.AddrawMaterial(dto);
        }
        [HttpGet]
       public async Task<ResultDto<RawMaterial>> GetRawMaterial(int id)
        {
            return await processingrServices.GetRawMaterial(id);
        }
        [HttpPost]
       public async Task<ResultDto<int>> AddAccessories(AccessoriesDto dto)
        {
            return await processingrServices.AddAccessories(dto);
        }
        [HttpGet]
       public async Task<ResultDto<Accessories>> GetAccessories(int id)
        {
            return await processingrServices.GetAccessories(id);
        }
        [HttpPost]
       public async Task<ResultDto<int>> AddAdditive(AdditiveDto dto)
        {
            return await processingrServices.AddAdditive(dto);
        }
        [HttpGet]
       public async Task<ResultDto<Additive>> GetAdditive(int id)
        {
            return  await processingrServices.GetAdditive(id);
        }
        [HttpPost]
      public async  Task<ResultDto<int>> AddPackagingMaterials(PackagingMaterialsDto dto)
        {
            return await processingrServices.AddPackagingMaterials(dto);
        }
        [HttpGet]
       public async Task<ResultDto<PackagingMaterials>> GetPackagingMaterials(int id)
        {
            return await processingrServices.GetPackagingMaterials(id);
        }
    }
}
